package pt.nmfa.peste.entity;

// Generated Mar 5, 2011 1:52:20 PM by Hibernate Tools 3.3.0.GA

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.validator.NotNull;

/**
 * ChannelsCategory generated by hbm2java
 */
@Entity
@Table(name = "ChannelsCategory", catalog = "HomeDB")
public class ChannelsCategory implements java.io.Serializable {

	private ChannelsCategoryId id;
	private Category category;
	private Channels channels;

	public ChannelsCategory() {
	}

	public ChannelsCategory(ChannelsCategoryId id, Category category,
			Channels channels) {
		this.id = id;
		this.category = category;
		this.channels = channels;
	}

	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "id", column = @Column(name = "id", nullable = false)),
			@AttributeOverride(name = "epgpos", column = @Column(name = "epgpos", nullable = false, length = 4)) })
	@NotNull
	public ChannelsCategoryId getId() {
		return this.id;
	}

	public void setId(ChannelsCategoryId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "categoryId", nullable = false)
	@NotNull
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "epgpos", nullable = false, insertable = false, updatable = false)
	@NotNull
	public Channels getChannels() {
		return this.channels;
	}

	public void setChannels(Channels channels) {
		this.channels = channels;
	}

}
